package cn.udinghuo.model.goods.infrastructure.vo;

import com.fasterxml.jackson.annotation.JsonSetter;

import org.springframework.util.Assert;
import java.io.Serializable;
import cn.udinghuo.core.domain.entity.BaseAuditTenantAndDeleted;	
import java.util.List;	
import cn.udinghuo.model.goods.infrastructure.RoundType;	
import cn.udinghuo.model.goods.infrastructure.ProductUnit;
/**
 * @author shizm
 *	计量单位
 */
public class ProductUnitVo implements Serializable{

	private static final long serialVersionUID = -1107296257L;
	
	/**
	*主键id
	*/
	private Long id;
	
	/**
	* 计量单位编码cCode
	*/
	private String cCode;
	/**
	* 计量单位名称cName
	*/
	private String cName;
	/**
	* 数据来源IDcOutSysKey
	*/
	private String cOutSysKey;
	/**
	* erp编码cErpCode
	*/
	private String cErpCode;
	/**
	* 小数位数unitPrecision
	*/
	private Short unitPrecision;
	/**
	* 舍入方式 0:四舍五人，1:入，2:舍unitRoundType
	*/
	private Short unitRoundType;
	/**
	* 舍入方式字符串unitRoundTypeStr
	*/
	private String unitRoundTypeStr;

	public Long getId() {
		return this.id;
	}
	
	public void setId(Long value) {
		this.id = value;
	}
	
	public String getCode() {
		return this.cCode;
	}
	
	public void setCode(String value) {
		this.cCode = value;
	}
	
	public String getName() {
		return this.cName;
	}
	
	public void setName(String value) {
		this.cName = value;
	}
	
	public String getOutSysKey() {
		return this.cOutSysKey;
	}
	
	public void setOutSysKey(String value) {
		this.cOutSysKey = value;
	}
	
	public String getErpCode() {
		return this.cErpCode;
	}
	
	public void setErpCode(String value) {
		this.cErpCode = value;
	}
	
	public Short getUnitPrecision() {
		return this.unitPrecision;
	}
	
	public void setUnitPrecision(Short value) {
		this.unitPrecision = value;
	}
	
	public RoundType getUnitRoundType() {
		return RoundType.find(this.unitRoundType.intValue());
	}
	
	@JsonSetter
	public void setUnitRoundType(RoundType value) {
		Assert.notNull(value, "enum value is invalid value!");
		this.unitRoundType = value.getValue();
	}
	
	public void setUnitRoundType(Short value) {
		Assert.notNull(value,"enum value is invalid value!");
		Assert.notNull(RoundType.find(value.intValue()),"enum value is invalid value!"); 
		this.unitRoundType = value;
	}
	
	public String getUnitRoundTypeStr() {
		return this.unitRoundTypeStr;
	}
	
	public void setUnitRoundTypeStr(String value) {
		this.unitRoundTypeStr = value;
	}

    @Override
    public String toString() {
        return super.toString();
    }
}
